<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增用户卡片')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-coupon-add">
            <input name="userId" th:field="${user.userId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">卡片：</label>
                <div class="col-sm-8">
                    <select name="couponId" class="form-control m-b" required>
                       <option value="1">请选择</option>
                        <option value="1">月卡</option>
                        <option value="1">半年卡</option>
                        <option value="1">年卡</option>
                    </select>
                </div>
            </div>
            
             <div class="form-group">
                <label class="col-sm-3 control-label">加量包：</label>
                <div class="col-sm-8">
                    <select name="couponId" class="form-control m-b" required>
                       <option value="1">请选择</option>
                        <option value="1">5人</option>
                        <option value="1">10人</option>
                        <option value="1">20人</option>
                    </select>
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-sm-3 control-label">生效时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="startTime" class="form-control" placeholder="yyyy-MM-dd" type="text" autocomplete="off">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">过期时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input name="endTime" class="form-control" placeholder="yyyy-MM-dd" type="text" autocomplete="off">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "system/user"
        $("#form-coupon-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/路径", $('#form-coupon-add').serialize());
            }
        }

        $("input[name='startTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>